import { HETAxios, urlCombine } from "./HETAxios.js";
/**
 * HETAxios(param1,param2,param3,param4)
 * param1 请求类型，必填（全部大写）
 * param2 请求地址，必填
 * param3 请求负载（对象的形式{}）
 * param4 请求头，选填（需要设置请求头时添加，例：{headers:{xxx-asd: '123'}}）
 **/

// 退出登录
export const logout = (param) => HETAxios('POST',"logout",param)
// 获取首页卫士数量信息
export const req_getDevicesCount = () => HETAxios('GET',"guardServer/device/getCount")
// 获取首页全部卫士状态
export const req_getGuardHomeInfo = () => HETAxios('GET',"guardServer/device/home/guardHomeInfo")
// 获取单个卫士状态
export const req_getGuardInfo = (deviceId) => HETAxios('GET',`guardServer/device/${deviceId}/home/status`)

// 首页设备信息
export const req_getProductionInfo = () => HETAxios('GET',`guard/allProductInfo/get`)
// 升级日期
export const req_getUpdateTime = () => HETAxios('GET',`files/console/lastsuccessfulupgrade`)

// // 获取卫士设备
// export const req_getGuardDevices = (param) => HETAxios('GET',"guard/device/get",param)
// // 获取卫士设备数目
// export const req_getGuardDevicesCount = (param) => HETAxios('GET',"guard/device/getDeviceCount",param)
// // 删除卫士设备
// export const req_delGuardDevice = (oid) => HETAxios('POST',"guard/device/batchDelete/c132dfe6-9c14-4192-b25f-111264191c49/oids?oids="+oid)
// // 修改卫士设备名
// export const req_deviceChangeName = (url) => HETAxios('POST',"guard/changeName"+url)
// // 获取新发现设备
// export const req_getNewDevices = (param) => HETAxios('GET',"guard/device/tmp/get",param)
// 获取新发现设备数量
export const req_getNewDevicesCount = () => HETAxios('GET',"guard/device/tmp/getCount")
// // 将新发现卫士加入拓扑
// export const req_newDeviceTopology = (oid) => HETAxios('POST',"guard/device/topology/c132dfe6-9c14-4192-b25f-111264191c49/"+oid)
// // 删除新发现卫士
// export const req_delNewDevices = (oid) => HETAxios('POST',"guard/device/tmp/delete/c132dfe6-9c14-4192-b25f-111264191c49/"+oid)
// // 获取卫士设备基本信息
// export const req_getGuardInfo = (url) => HETAxios('GET',"guard/device/detail"+url)
// // 获取卫士syslog
// export const req_getGuardSysLog = (param) => HETAxios('GET',"guard/guardLogs/get",param)
// // 获取卫士syslog数目
// export const req_getGuardSysLogCount = (param) => HETAxios('GET',"guard/guardLogs/getGuardLogsCount",param)
// // 获取应用程序白名单
// export const req_getGuardWhiteList = (param) => HETAxios('GET',"guard/guardAppWhiteList/get",param)
// // 获取应用程序白名单数目
// export const req_getGuardWhiteListCount = (param) => HETAxios('GET',"guard/guardAppWhiteList/getCount",param)
// // 应用程序白名单同步
// export const req_guardWhiteListSync = (oid) => HETAxios('POST',"guard/guardWhitelist/"+oid+"/sync")
// // 获取外设列表
// export const req_getGuardPeripheral = (param) => HETAxios('GET',"guard/guardPeripheral/get",param)
// // 获取外设总数目
// export const req_getGuardPeripheralCount = (param) => HETAxios('GET',"guard/guardPeripheral/getGuardPeripheralCount",param)
// // 外设同步
// export const req_guardPeripheralSync = (oid) => HETAxios('POST',"guard/guardPeripheral/"+oid+"/sync")

// // 添加分组
// export const req_addGroup = (params) => HETAxios('POST',"category/add?" + urlCombine(params))
// // 修改分组
// export const req_editGroup = (params) => HETAxios('POST',"category/update?" + urlCombine(params))
// // 删除分组
// export const req_delGroup = (params) => HETAxios('POST',"category/delete?" + urlCombine(params))

// // 修改设备分组
// export const req_setDevicesGroup = (params) => HETAxios('POST',"category/updateGuardCategory",params)

// 修改用户密码
export const req_setUserPassword = (params) => HETAxios('PUT',"users/password",params)

// 用户管理获取用户列表
export const req_getSystemUsers = (params) => HETAxios('GET',"auth/list", params)
// 用户管理锁定用户
export const req_lockedSystemUser = (userId) => HETAxios('PUT',"users/user/lock/" + userId)
// 用户管理解锁用户
export const req_unlockSystemUser = (userId) => HETAxios('PUT',"users/user/unlock/" + userId)
// 用户管理编辑用户信息
export const req_setSystemUsers = (params) => HETAxios('PUT',"auth/info",params)
export const req_DelSystemUsers = (params) => HETAxios('DELETE',`auth/user/${params}`)

// 获取设备信息
export const req_getDeviceInfo = () => HETAxios('GET',"devices/topology/c132dfe6-9c14-4192-b25f-111264191c49/mw/systemstat")


/*************************外设白名单******************************* */

// 获取外设列表（USB/网卡）
export const req_getPeriphrealList = (deviceId, params) => HETAxios('GET',`strategyManager/peripheral/${deviceId}/getPeriphreal`,params)
// 删除USB
export const req_delUsbList = (deviceId, params) => HETAxios('DELETE',`strategyManager/peripheral/${deviceId}/deleteUsb`,params)
// 删除网卡
export const req_delNetList = (deviceId, params) => HETAxios('DELETE',`strategyManager/peripheral/${deviceId}/deleteNet`,params)
// 添加USB/网卡
export const req_addUsbNet = (deviceId, params) => HETAxios('POST',`strategyManager/peripheral/${deviceId}/addPeripheral`,params)
// 安全U盘
export const req_getUdisk = (deviceId) => HETAxios('GET',`strategyManager/device/${deviceId}/periphreal/udisk`)
// 外设设置-查询
export const req_getPeriphrealConfig = (deviceId, params) => HETAxios('POST',`strategyManager/device/${deviceId}/system/config`, params)
// 外设设置
export const req_setPeriphreal = (deviceId, params) => HETAxios('PUT',`strategyManager/device/${deviceId}/system/config`, params)
// 授信
export const req_changeCredit = (deviceId, params) => HETAxios('POST',`strategyManager/peripheral/${deviceId}/credit`, params)

/***************************主机加固 ************************************** */
// 安全基线查询-win
export const req_getBaselineConf = (deviceId) => HETAxios('GET',`strategyManager/device/${deviceId}/policy/sysInfoing`)
// 安全基线查询-linux
export const req_getBaselineConfLinux = (deviceId, params) => HETAxios('GET',`strategyManager/device/${deviceId}/policy/getBaseLine`,params)
// 安全基线自定义-win
export const req_setBaselineConf = (deviceId, params) => HETAxios('POST',`strategyManager/device/${deviceId}/policy/sysInfoing`,params)
// 安全基线自定义-linux
export const req_setBaselineConfLinux = (deviceId, params) => HETAxios('POST',`strategyManager/device/${deviceId}/policy/setBaseLine`,params)
// 安全基线-一键加固-win
export const req_reinforceBaseline = (deviceId) => HETAxios('POST',`strategyManager/device/${deviceId}/policy/sysInfoing/jg`)
// 安全基线-一键加固-linux
export const req_reinforceBaselineLinux = (deviceId) => HETAxios('POST',`strategyManager/device/${deviceId}/policy/batchBaseLine`)
// 安全基线-恢复默认-win
export const req_resetBaseline = (deviceId) => HETAxios('POST',`strategyManager/device/${deviceId}/policy/sysInfoing/hf`)
// 安全基线-恢复默认-linux
export const req_resetBaselineLinux = (deviceId) => HETAxios('POST',`strategyManager/device/${deviceId}/policy/restoreBaseLine`)
// 基线核查
export const req_verificationBaseline = (deviceId) => HETAxios('GET',`strategyManager/device/${deviceId}/policy/sysInfoing/hc`)
// 端口状态查询
export const req_getPortStatus = (deviceId, params) => HETAxios('GET',`strategyManager/device/${deviceId}/hostHardening/nativePort`, params)
// 拦截端口
export const req_disableFirewallConfig = (deviceId, params) => HETAxios('POST',`strategyManager/device/${deviceId}/hostHardening/disable`, params)
// 端口规则列表-win
export const req_getPortRules = (deviceId, params) => HETAxios('GET',`strategyManager/net/${deviceId}/firewallConfig`, params)
// 端口规则列表-linux
export const req_getPortRulesLinux = (deviceId, params) => HETAxios('GET',`strategyManager/net/${deviceId}/getNetRules`, params)
// 端口规则-拦截
export const req_portIntercept = (deviceId, params) => HETAxios('PUT',`strategyManager/net/${deviceId}/firewallConfig`, params)
// 新建端口规则-win
export const req_addPortRule = (deviceId, params) => HETAxios('POST',`strategyManager/net/${deviceId}/firewallConfig`, params)
// 新建端口规则-linux
export const req_addPortRuleLinux = (deviceId, params) => HETAxios('POST',`strategyManager/net/${deviceId}/addNetRules`, params)
// 删除端口规则-win
export const req_delPortRules = (deviceId, params) => HETAxios('DELETE',`strategyManager/net/${deviceId}/firewallConfig`, params)
// 删除端口规则-linux
export const req_delPortRulesLinux = (deviceId, params) => HETAxios('POST',`strategyManager/net/${deviceId}/deleteNetRules`, params)
// 修改端口规则-linux
export const req_setPortRulesLinux = (deviceId, params) => HETAxios('POST',`strategyManager/net/${deviceId}/updateNetRules`, params)
// 扫描端口规则-linux
export const req_scanPortRulesLinux = (deviceId) => HETAxios('POST',`strategyManager/net/${deviceId}/sacnNetRules`)
// 端口设置-查询-win
export const req_getFirewallStatus = (deviceId) => HETAxios('GET',`strategyManager/net/${deviceId}/firewall/status`)
// 端口设置-查询-linux
export const req_getFirewallStatusLinux = (deviceId,params) => HETAxios('POST',`strategyManager/device/${deviceId}/system/config`,params)
// 端口设置-win
export const req_setFirewallStatus = (deviceId, params) => HETAxios('POST',`strategyManager/net/${deviceId}/firewall/status`, params)
// 端口设置-linux
export const req_setFirewallStatusLinux = (deviceId, params) => HETAxios('PUT',`strategyManager/device/${deviceId}/system/config`, params)

/***********************************注册表防护 **********************************************/
// 获取注册表规则列表
export const req_regProtectList = (deviceId, params) => HETAxios('GET',`strategyManager/device/${deviceId}/regedit/protect`, params)
// 新建注册表规则
export const req_addRegProtect = (deviceId, params) => HETAxios('POST',`strategyManager/device/${deviceId}/regedit/protect`, params)
// 删除注册表规则
export const req_delRegProtect = (deviceId, params) => HETAxios('DELETE',`strategyManager/device/${deviceId}/regedit/protect`, params)
// 注册表防护状态查询
export const req_getRegProtectStatus = (deviceId, params) => HETAxios('POST',`strategyManager/device/${deviceId}/system/config`, params)
// 注册表防护设置
export const req_setRegProtectStatus = (deviceId, params) => HETAxios('PUT',`strategyManager/device/${deviceId}/system/config`, params)

/***************************************文件防护 *********************************************/
// 文件防护查询
export const req_getFileProtectConfig = (deviceId, params) => HETAxios('POST',`strategyManager/device/${deviceId}/system/config`, params)
// 文件防护设置
export const req_setFileProtectConfig = (deviceId, params) => HETAxios('PUT',`strategyManager/device/${deviceId}/system/config`, params)

/**********************************日志设置 *************************************************/
// 日志设置-查询
export const req_getLogSetInfo = (deviceId, params) => HETAxios('POST',`strategyManager/device/${deviceId}/system/config`, params)
// 日志设置-设置
export const req_setLogSetInfo = (deviceId, params) => HETAxios('PUT',`strategyManager/device/${deviceId}/system/config`, params)

/**********************************数据存储 ****************************************************/
// 数据存储-查询
export const req_getDataStorage = (deviceId, params) => HETAxios('POST',`strategyManager/device/${deviceId}/system/config`, params)
// 数据存储-设置
export const req_setDataStorage = (deviceId, params) => HETAxios('PUT',`strategyManager/device/${deviceId}/system/config`, params)
// 数据库备份
export const req_databaseBackup = (deviceId) => HETAxios('POST',`strategyManager/log/${deviceId}/db/backup`)
// 数据库备份列表查询
export const req_getDbBackupList = (deviceId) => HETAxios('GET',`strategyManager/log/${deviceId}/db/backup`)
// 数据库恢复
export const req_databaseRevovery = (deviceId, params) => HETAxios('POST',`strategyManager/log/${deviceId}/db/recovery`, params)

/*********************************************接入管理 ***************************************************/
// 接入审批列表总数
export const req_getGuardApproveCount = (params) => HETAxios('GET',`loadManager/approve/getGuardApproveCount`, params)
// 接入审批列表
export const req_getGuardApprove = (params) => HETAxios('GET',`loadManager/approve/getGuardApprove`, params)
// 接入审批
export const req_guardApprove = (params) => HETAxios('POST',`loadManager/approve/guard/load`, params)
export const req_guardApproveDelete = (params) => HETAxios('POST',`loadManager/approve/guard/delete`, params)
// 审批自动开关-查询
export const req_getAutoApproveStatus = (name) => HETAxios('GET',`loadManager/global/${name}`)
// 审批自动开关-设置
export const req_setAutoApproveStatus = (params) => HETAxios('POST',`loadManager/global/setValue`, params)

// 获取系统上次更新时间
export const req_getSysLastUpdateTime = () => HETAxios('GET',`files/console/lastsuccessfulupgrade`)
// 获取系统序列号
export const req_getSysSerialnumber = () => HETAxios('GET',`sysbaseinfo/serialnumber`)
// 系统升级
export const req_systemUpgrade = () => HETAxios('POST',`files/console/upgrade`)
// 获取系统版本号
export const req_getSystemVersionNumber = () => HETAxios('GET',`systemsetting/configuration/item/buildVersion`)


/*********************************操作日志 ********************************************************/
// 操作日志列表
export const req_getOperationLogs = (params) => HETAxios('GET',`operationlogs/operate/list`,params)
// 操作日志总数
export const req_getOperationLogsCount = (params) => HETAxios('GET',`operationlogs/operate/count`,params)
// 登录日志列表
export const req_getLoginLogs = (params) => HETAxios('GET',`operationlogs/login/list`,params)
// 登录日志总数
export const req_getLoginLogsCount = () => HETAxios('GET',`operationlogs/login/count`)
// 系统日志总数
export const req_getSystemLogsCount = (params) => HETAxios('GET',`operationlogs/system/count`,params)
// 系统日志列表
export const req_getSystemLogs = (params) => HETAxios('GET',`operationlogs/system/list`,params)

/***********************************终端用户管理 **********************************************/
// 终端用户列表总数
export const req_getTerminalUserCount = (oid) => HETAxios('GET',`userManager/${oid}/deviceUserCount`)
// 终端用户列表
export const req_getTerminalUserList = (oid, params) => HETAxios('GET',`userManager/${oid}/deviceUserList`, params)
// 新增终端用户
export const req_addTerminalUser = (params) => HETAxios('POST',`userManager/deviceUser/add`, params)
export const req_addSystemUser = (params) => HETAxios('POST',`auth/register`, params)
// 修改密码
export const req_setPassword = (params) => HETAxios('POST',`userManager/deviceUser/updatePassword`, params)
// 删除终端用户
export const req_delTerminalUser = (params) => HETAxios('DELETE',`userManager/deviceUser/delete`, params)
// 终端角色列表
export const req_getTerminalRoleList = () => HETAxios('GET',`userManager/guardRole/list`)
export const req_getSystemRoleList = () => HETAxios('GET',`userManager/systemRole/list`)
// 同步终端用户
export const req_syncTerminalUsers = (params) => HETAxios('POST',`userManager/deviceUser/sync`, params)

/************************************鉴权用户 ***********************************************/
// 终端用户列表总数
export const req_getAuthorUserCount = () => HETAxios('GET',`userManager/guardUserCount`)
// 终端用户列表
export const req_getAuthorUserList = (params) => HETAxios('GET',`userManager/guardUserList`, params)
// 新增终端用户
export const req_addAuthorUser = (params) => HETAxios('POST',`userManager/guardUser/add`, params)
// 修改密码
export const req_setAuthorPassword = (params) => HETAxios('POST',`userManager/guardUser/updatePassword`, params)
// 删除终端用户
export const req_delAuthorUser = (params) => HETAxios('DELETE',`userManager/guardUser/delete`, params)

/**************************************全局策略 *************************************************/
// 服务器策略列表
export const req_getServerStrategyList = (params) => HETAxios('GET',`globalStrategy/strategy/getServerStrategy`, params)
// 服务器策略列表总数
export const req_getServerStrategyCount = (params) => HETAxios('GET',`globalStrategy/strategy/getServerStrategyCount`, params)
// 服务端策略类型
export const req_getServerStrategyTypes = () => HETAxios('GET',`globalStrategy/strategy/typeList`)
// 删除服务器策略
export const req_delServerStrategy = (id) => HETAxios('DELETE',`globalStrategy/strategy/serverStrategy/${id}`)
// 服务器策略部署到组
export const req_deployStrategyToGroup = (id, params) => HETAxios('POST',`globalStrategy/strategy/deploy/${id}`, params)
// 组策略查询
export const req_getGroupStrategyList = (params) => HETAxios('GET',`globalStrategy/category/setting`,params)
// 组策略取消部署
export const req_delGroupStrategy = (params) => HETAxios('DELETE',`globalStrategy/category/setting`,params)
// 服务端策略详情
export const req_serverStrategyDetail = (id, params) => HETAxios('GET',`guardServer/strategy/detail/${id}`,params)
// 组策略部署状态查询
export const req_groupStrategyDetail = (params) => HETAxios('GET',`guardServer/category/setting/status`,params)
// 策略备份-列表
export const req_getStartegyBackupList = (params) => HETAxios('GET',`globalStrategy/backup/getStrategyList`,params)
// 策略备份-列表总数
export const req_getStartegyBackupCounts = () => HETAxios('GET',`globalStrategy/backup/getStrategyCount`)
//服务器策略 - 执行备份
export const req_backupStrategy = () => HETAxios('POST',`globalStrategy/backup/save`)
//服务器策略 - 恢复
export const req_restoreBackupStrategy = (params) => HETAxios('POST',`globalStrategy/backup/restore`,params,{
  headers: {
    'Content-Type': 'multipart/form-data'
  }
})
//服务器策略 - 删除
export const req_delStrategyBackup = (id) => HETAxios('DELETE',`globalStrategy/backup/delete?id=${id}`)

/*********************************************终端卸载密码 ****************************/
// 查询
export const req_getUnloadAuthPass = () => HETAxios('GET',`userManager/unloadauth/get`)
// 修改
export const req_setUnloadAuthPass = (params) => HETAxios('POST',`userManager/unloadauth/update`,params)
// 同步
export const req_asyncUnloadAuthPass = (params) => HETAxios('POST',`userManager/unloadauth/sync`,params)


export const req_getCategorySetting = (params) => HETAxios('GET',`globalStrategy/category/settingGroup`,params)

/*******************************************强访问控制 **********************************/
// 规则列表
export const req_getAccessControlList = (params) => HETAxios('GET',`strategyManager/access/access/list`,params)
// 新建规则
export const req_addAccessControl = (params) => HETAxios('POST',`strategyManager/access/access/add`,params)
// 规则详情
export const req_getAccessControlDetail = (params) => HETAxios('GET',`strategyManager/access/access/detail`,params)
// 删除规则
export const req_delAccessRule = (params) => HETAxios('POST',`strategyManager/access/access/delete`,params)

/*******************************************完整性检查 *************************************/
// 规则列表
export const req_getCompleteRuleList = (params) => HETAxios('GET',`strategyManager/complete/rule/list`,params)
// 新建规则
export const req_addCompleteRule = (params) => HETAxios('POST',`strategyManager/complete/rule/add`,params)
// 规则详情
export const req_getCompleteRuleDetail = (params) => HETAxios('GET',`strategyManager/complete/rule/detail`,params)
// 删除规则
export const req_delCompleteRule = (params) => HETAxios('POST',`strategyManager/complete/rule/delete`,params)
// 模型下拉框选项
export const req_getCompleteModelList = () => HETAxios('GET',`strategyManager/complete/model/list`)
// 文件列表
export const req_getPathList = () => HETAxios('GET',`strategyManager/complete/path/list`)